<?php

/*

RaNDoM $pointsVar (random_$pointsVar.pro.php)

*/
ob_start();
$rank_check = 1;
include "global.inc.php";

$limit1 = 21600;
$timeLimit = "6 Hours";
if ($getInfo[premium] == 1) { $limit1 = 10800; $timeLimit = "3 Hours"; }

// Start Check

$checking = "random_points";
$limit = $timestamp - $limit1;

$findCheck = fetch("SELECT * FROM checking2 WHERE userid = '$userid' AND check_what = '$checking' AND timestamp > '$limit' AND game = '$game'");

// End Check

if ($findCheck[id])
{
	die(header(error("random_points.php?game=$game","You can not play right now!!")));
}

$randohms = rand(0,500);
points("$game", "$username", "$randohms");

mysql_query("DELETE FROM checking2 WHERE userid = '$userid' AND check_what = '$checking' AND game = '$game'");
mysql_query("INSERT INTO checking2 (userid,check_what,timestamp,game) VALUES ('$userid','$checking','$timestamp','$game')");

die(header(error("random_points.php?game=$game","You won $randohms $pointsVar!!")));

?>